<template>
  <div class="main_box" style="padding:10px">
    <div class="detail_wrap">
      <div class="tit">
        <h2>基础信息</h2>
        <el-button type="success" plain size="small" icon="fa fa-mail-forward" @click="returnList"> 返 回</el-button>
      </div>
      <div class="con">
        <ul>
          <li class="label">
            <label class="label">角色类型:</label>
            <span v-if="detailData.roleType == 1">系统</span>
            <span v-if="detailData.roleType == 2">H5</span>
          </li>
          <li>
            <label class="label">角色名称:</label>
            <span>{{detailData.roleName}}</span>
          </li>
          <li>
            <label class="label">角色描述:</label>
            <span>{{detailData.descriptions}}</span>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import AuthApi from "@/api/system/auth";
export default{
    data(){
        return {
          detailData: []
        }
    },
    mounted(){
      this.init();
    },
    methods:{
      init(){
        this.getData();
      },
      getData(){
        AuthApi.getRoleInfo({roleId:this.$route.query.id})
        .then(res => {
          this.detailData = res.data;
        })
      },
      returnList(){
        this.$store.dispatch('delView', this.$route);
        this.$router.push({path: '/sys/roleManagement'})
      }
    },
}
</script>
<style lang="scss" scoped>
@import "@/assets/css/views/Detail.scss";
</style>
